<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="POI.*,java.util.*;" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>POI list</title>
</head>
<body>

<%!
public String getFormatedGeoTable()
{
	GeoInfoList infoList = new GeoInfoList();
	if(!infoList.loadFromFile("GeoServlet\\poidata.csv"))
		return "<b>Error reading from file!</b>";
	//infoList.
	String htmlTable= new String();
	htmlTable = "<table width=\"100%\" border=1><tr align=center bgcolor=\"lightgrey\"><td>ID</td><td>Name</td><td>Type</td><td>Latitde</td><td>Longtitde</td></tr>";
	Iterator<GeoInfo> it = infoList.iterator();
	while(it.hasNext())
	{
		GeoInfo val = it.next();
		htmlTable += "<tr><td>"+val.getID()+"</td>"+
					 "<td>"+val.getLocationName()+"</td>"+
					 "<td>"+val.getLocationTypeName()+"</td>"+
					 "<td>"+val.getLatitude()+"</td>"+
					 "<td>"+val.getLongtitude()+"</td></tr>";
	};
	htmlTable+="</table>";
	return htmlTable;
	
}
%>
<%=getFormatedGeoTable() %>

</body>
</html>